package com.order.shiro;

import com.order.model.sys.SysUser;

public class ShiroPrincipal {

	/**用户对象*/
	private SysUser user;
	
	/**构造函数，参数为User对象 根据User对象属性，赋值给Principal相应的属性上*/
	public ShiroPrincipal(SysUser user){
		this.user = user;
	}
	
	/**登录用户ID*/
	public int getUserId(){
		return this.user.getNumber(SysUser.ID).intValue();
	}
	
	/**登录用户名*/
	public String getUserName(){
		return this.user.getStr(SysUser.NAME);
	}
	

	public SysUser getUser() {
		return user;
	}

	public void setUser(SysUser user) {
		this.user = user;
	}
	
	
}
